from selenium import webdriver
from selenium.webdriver.common.by import By

name=input("请输入用户名")
mima=input("请输入密码")
bumen=input("请输入部门名")
miaoshu=input("请输入部门描述")

wd = webdriver.Chrome()
wd.maximize_window()
wd.get("http://localhost:88/ciircrm/index.php?m=user&a=login")
wd.find_element(By.XPATH,"/html/body/div[2]/div/div[2]/div/form/fieldset/input[1]").send_keys(name)
wd.find_element(By.XPATH,"/html/body/div[2]/div/div[2]/div/form/fieldset/input[2]").send_keys(mima)
wd.find_element(By.XPATH,"/html/body/div[2]/div/div[2]/div/form/fieldset/input[3]").click()

wd.find_element(By.LINK_TEXT,"系统").click()
wd.find_element(By.LINK_TEXT,"组织架构").click()
wd.find_element(By.LINK_TEXT,"添加部门").click()
wd.find_element(By.ID,"dialog-message2").click()
wd.implicitly_wait(2)
wd.find_element(By.XPATH,"//*[@id='name']").send_keys(bumen)
wd.find_element(By.XPATH,"/html/body/div[9]/div[3]/div/button[1]").click()


